## This code creates Table A5.

# Table A5

data <- sittan_towns_shp

data$replaced <- 1 - data$hereditary

household_tax_OLS <- lm(household_tax~replaced+pop_1783+as.factor(region),data=data@data)
paddy_tax_OLS <- lm(paddy_tax~replaced+pop_1783+as.factor(region),data=data@data)
fishery_tax_OLS <- lm(fishery_tax~replaced+pop_1783+as.factor(region),data=data@data)

tax_specs <- c("household_tax_OLS","paddy_tax_OLS","fishery_tax_OLS")

tax_table <- matrix(nrow = 7,ncol=4)

for(i in 1:length(tax_specs)){
  tax_table[1,i+1] <- tax_specs[i]
  model <- get(tax_specs[i])
  coef <- round(summary(model)$coefficients[2],digits=4)
  se <- round(summary(model)$coefficients[2,2],digits=4)
  tax_table[2,i+1] <- coef
  tax_table[3,i+1] <- paste0("(",se,")")
  tax_table[4,i+1] <- paste0("[",round(coef-1.96*se,digits=4),",")
  tax_table[5,i+1] <- paste0(round(coef+1.96*se,digits=4),"]")
  tax_table[6,i+1] <- nobs(model)
  tax_table[7,i+1] <- round(summary(model)$adj.r.squared,digits=4)
}

xtable(tax_table)
